<script>
		/* Global var for counter */
		var serviceCount = 0;

		$(function() {
			/* 预览*/
			 $("#editSubmit").click(function(){
			 	var isOkFlg = "OK";
		    	$("#user-register input").each(function(i){
		    		if($(this).attr('id')	== 'organizer' ||
		    		   $(this).attr('id')	== 'tel' ||
					   $(this).attr('id')	== 'conferenceName'||
					   $(this).attr('id')	== 'from'||
					   $(this).attr('id')	== 'to'||
					   $(this).attr('id')	== 'venue'||
					   $(this).attr('id')	== 'membersFee'||
					   $(this).attr('id')	== 'freeMembersFee'||
					   $(this).attr('id')	== 'freeStudentMembersFee'||
					   $(this).attr('id')   == 'headcountLimit' ||
					   ($(this).attr('name')).substring(0,11) == 'serviceName'||
					   ($(this).attr('name')).substring(0,12) == 'membersPrice'||
					   ($(this).attr('name')).substring(0,16) == 'freeMembersPrice'||
					   ($(this).attr('name')).substring(0,23) == 'freeStudentMembersPrice'||
					   ($(this).attr('name')).substring(0,5) == 'limit'){
						  	if(!$(this).val().length){
						  		$(this).css("background-color","#ffb6c1");
						  		isOkFlg = "NG";
							 }else{
								if($(this).css("background-color") == "rgb(255, 182, 193)"){;
									$(this).css("background-color","#EEEEFF");
								}
							}
		    		}
				});
		    	if(isOkFlg == "OK"){
					//form submit
		    		$("#user-register").submit();
				 }
			 });

			 $.datepicker.setDefaults($.datepicker.regional['nl']);
			 $.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
			/* 日历 */
			$( "#from" ).datepicker({
				changeMonth: true,
				changeYear: true
			});
			$( "#to" ).datepicker({
				changeMonth: true,
				changeYear: true
			});


			/* */
			$("#delService").click(function(){
				if(serviceCount > 0){
					$('table#example tbody tr:last').remove();
					serviceCount--;
				}
			});
			$("#addService").click(function(){

					$("table#example tbody ").append(gethtmlStr());
					serviceCount++;

			});

		/*  */
		function gethtmlStr(){
			var htmlStr = '';
			htmlStr += '<tr>';
			htmlStr += '	<td><input type="text" style="width:200px;" class="form-text required" value="" name="serviceName[]"></td>';
			htmlStr += '	<td><input type="text" style="width:100px;" class="form-text required" value="" name="membersPrice[]"></td>';
			htmlStr += '	<td><input type="text" style="width:100px;" class="form-text required" value="" name="freeMembersPrice[]"></td>';
			htmlStr += '	<td><input type="text" style="width:100px;" class="form-text required" value="" name="freeStudentMembersPrice[]"></td>';
			htmlStr += '	<td><input type="text" style="width:100px;" class="form-text required" value="" name="limit[]"></td>';
			htmlStr += '</tr>';

			return htmlStr;
		}


		$(document).ready(function() {
			$('#example').dataTable();
			$('#example_length').remove();
			$('#example_filter').remove();
			$('#example_info').remove();
			$('#example_paginate').remove();
		} );


		});
	</script>


<!-- /.section, /#navigation -->
<div id="main-wrapper">
  <div class="clearfix with-navigation" id="main">
    <div class="column" id="content">
      <div class="section">
      		<!--{$htmlErrMsg}-->
          	<div id="content-area" style='min-height:650px'>
          		<div style = "display:table-cell;text-align:left; width: 960px;">
          			<h3>Edite conference </h3>
          			<hr>
          		</div>

          		<form action="<!--{$smarty.const.HTTP_URL}-->conference/index.php" method="post" id="user-register" >
	          		<div class="form-item" id="edit-mail-wrapper">
		              <input name="bk" id="back" value="Go back" class="form-submit" type="button" onclick='history.back();' style=" float:right; width:100px; ">
		              <input name="editSubmit" id="editSubmit" value="Save" class="form-submit" type="button" style=" float:right; width:100px; ">
	              	</div>
          			<input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
          			<input type="hidden" name="mode" id="mode" value="updateConference" />
          			<input type="hidden" name="serviceCount" id="serviceCount" value="<!--{$serviceCount}-->" />
          			<input type="hidden" name="conferenceId" id="conferenceId" value="<!--{$conferenceInfo.id|escape}-->" />
	              <!-- conferenceName -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Conference Name:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="conferenceName"
	                		id="conferenceName"
	                		value="<!--{$conferenceInfo.conferenceName|escape}-->"
	                		class="form-text required"
	                		type="text"  />

	              </div>
	               <!-- Conference Time -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Conference Time:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="from"
	                		id="from"
	                		value="<!--{$conferenceInfo.from|escape}-->"
	                		class="form-text required"
	                		type="text" style = "width:80px;" />
	                <span style='color: #1B2E79;' title="This field is required."> --- </span>
	                <input name="to"
	                		id="to"
	                		value="<!--{$conferenceInfo.to|escape}-->"
	                		class="form-text required"
	                		type="text" style = "width:80px;"  />
	                <span class="form-required" title="This field is required.">&nbsp </span>
	              </div>
	                <!-- Venue -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Venue:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="venue"
	                		id="venue"
	                		value="<!--{$conferenceInfo.venue|escape}-->"
	                		class="form-text required"
	                		type="text"  />

	              </div>

	              <!-- Conference Summary -->
	              <div class="form-item" id="edit-field-keywords-0-value-wrapper">
	                <label for="edit-field-keywords-0-value"> Summary:
	                	<span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <div class="resizable-textarea">
	                  <span>
	                    <textarea cols="60" rows="5"
	                    		  name="summary"
	                    		  id="summary"
	                    		  class="form-textarea resizable textarea-processed">
	                    	<!--{$conferenceInfo.summary|escape}-->
	                    </textarea>
	                  </span>
	                </div>
	              </div>
	               <!-- Organizer -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Organizer:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="organizer"
	                		id="organizer"
	                		value="<!--{$conferenceInfo.organizer|escape}-->"
	                		class="form-text required"
	                		type="text"  />

	              </div>

	              <!-- Tel -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Tel:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="tel"
	                		id="tel"
	                		value="<!--{$conferenceInfo.tel|escape}-->"
	                		class="form-text required"
	                		type="text"  />

	              </div>
	              <!-- Fax -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Fax:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="fax"
	                		id="fax"
	                		value="<!--{$conferenceInfo.fax|escape}-->"
	                		class="form-text required"
	                		type="text" s />

	              </div>
	              <!-- Attachment -->
	              <div class="form-item" id="edit-mail-wrapper">
	                <label for="edit-mail">Attachment:
	                <span class="form-required" title="This field is required.">&nbsp </span>
	                </label>
	                <input name="attachment"
	                		id="attachment"
	                		value="<!--{$conferenceInfo.attachment|escape}-->"
	                		class="form-text required"
	                		type="text"  />

	              </div>

	              	<div class="form-item" id="edit-mail-wrapper" style = "width: 960px;float:right">
		              <input name="bk" id="delService" value="Del Service" class="form-submit" type="button" style=" float:right; width:100px; ">
		              <input name="op" id="addService" value="Add Service" class="form-submit" type="button" style=" float:right; width:100px; ">
	              	</div>
	              	<div style = "display:table-cell;text-align:left; width: 960px;" >
          				<hr>
          			</div>

					<!--{section name=counter loop=$conferenceFeeInfo }-->
						<input type="hidden" name="checkServiceName[]"  value="<!--{$conferenceFeeInfo[counter].fees_name|escape}-->" />
						<input type="hidden" name="checkMembersPrice[]"  value="<!--{$conferenceFeeInfo[counter].member_price|escape}-->" />
						<input type="hidden" name="checkFreeMembersPrice[]"  value="<!--{$conferenceFeeInfo[counter].free_member_price|escape}-->" />
						<input type="hidden" name="checkFreeStudentMembersPrice[]"  value="<!--{$conferenceFeeInfo[counter].free_student_price|escape}-->" />
						<input type="hidden" name="checkLimit[]"  value="<!--{$conferenceFeeInfo[counter].head_limit|escape}-->" />
						<input type="hidden" name="feeId[]"  value="<!--{$conferenceFeeInfo[counter].id|escape}-->" />
					<!--{/section}-->
          			<div id="demo" style = "min-height:150px;">
						<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
							<thead>
								<tr>
									<th>ServiceName</th>
									<th>Member Price</th>
									<th>Free Member Price</th>
									<th>Free Member Price(Student)</th>
									<th>limit</th>
									<th>Edit</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>Conference Fee</td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceInfo.membersFee|escape}-->" id="membersFee" name="membersFee"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceInfo.freeMembersFee|escape}-->" id="freeMembersFee" name="freeMembersFee"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceInfo.freeStudentMembersFee|escape}-->" id="freeStudentMembersFee" name="freeStudentMembersFee"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceInfo.headcountLimit|escape}-->" id="headcountLimit" name="headcountLimit"></td>
									<td><input name="op" value="Delete" class="form-submit" type="button" style=" float:right; width:100px; "disabled></td>
								</tr>
								<!--{section name=counter loop=$conferenceFeeInfo }-->
								<tr>
									<input type="hidden" name="feeId[]"  value="<!--{$conferenceFeeInfo[counter].id|escape}-->" />
									<td><input type="text" style="width:200px;" class="form-text required" value="<!--{$conferenceFeeInfo[counter].fees_name|escape}-->" name="serviceName[]"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceFeeInfo[counter].member_price|escape}-->" name="membersPrice[]"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceFeeInfo[counter].free_member_price|escape}-->" name="freeMembersPrice[]"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceFeeInfo[counter].free_student_price|escape}-->" name="freeStudentMembersPrice[]"></td>
									<td><input type="text" style="width:100px;" class="form-text required" value="<!--{$conferenceFeeInfo[counter].head_limit|escape}-->" name="limit[]"></td>
									<td><input name="op" value="Delete" class="form-submit" type="button" style=" float:right; width:100px; "></td>
								</tr>
								<!--{/section}-->
							</tbody>
						</table>
					</div>
          </form>

        </div>

      </div>
    </div>
    <!-- /.section, /#content -->
  </div>
</div>
<!-- /#main, /#main-wrapper -->
